package platform.server;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @Title: PlatformServerApplication
 * @ProjectName com-bigwavn-group
 * @Description: spring-cloud-大浪商城后台管理中心服务启动类
 * @author: wangweitao
 * @date: 2019/4/17 14:25
 * @version: V1.0.0
 */

@EnableEurekaClient
@EnableAutoConfiguration(exclude = {
        org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
})
@EnableTransactionManagement
@ServletComponentScan
@MapperScan("platform.server.business.*.dao")
@SpringBootApplication
@EnableCaching
@EnableFeignClients(basePackages = {"product-api"})
public class PlatformServerApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = new SpringApplicationBuilder(
                PlatformServerApplication.class).run(args);
        // 写入PID
        context.addApplicationListener(new ApplicationPidFileWriter());
        System.out.println("ヾ(◍°∇°◍)ﾉﾞ大浪商城后台管理中心服务启动成功ヾ(◍°∇°◍)ﾉﾞ");
    }
}
